<div class="date-time">
    <div>
        <span class="font21 font-Light colorFF">Cuộc thi</span>
        <span class="font21 font-Bold colorFF">GUITAR</span>
        <span class="font21 font-Light colorFF">THÁNG</span>
        <span class="font21 font-Bold colorFF">{{ date('m',$contest->start) }}</span>
    </div>
    <div>
        <div class="displayin text-center">
            <p class="font38 colorFF font-Light" id="day1"></p>

            <p class="font20 colorFF font-seL">NGÀY</p>
        </div>
        <div class="displayin text-center"><p class="font38 colorFF font-Light positionR" style="top:-30px">:</p></div>
        <div class="displayin text-center">
            <p class="font38 colorFF font-Light" id="hour1"></p>

            <p class="font20 colorFF font-seL">GIỜ</p>
        </div>
        <div class="displayin text-center"><p class="font38 colorFF font-Light positionR" style="top:-30px">:</p></div>
        <div class="displayin text-center">
            <p class="font38 colorFF font-Light" id="min1"></p>

            <p class="font20 colorFF font-seL">PHÚT</p>
        </div>
        <div class="displayin text-center"><p class="font38 colorFF font-Light positionR" style="top:-30px">:</p></div>
        <div class="displayin text-center">
            <p class="font38 colorFF font-Light" id="second1"></p>

            <p class="font20 colorFF font-seL">GIÂY</p>
        </div>
    </div>
</div>
<div class="btn-event">
    @if($contest->end > time())
    <a class="btn-send-2" style="float: left" href="{{ route('gui-bai-du-thi') }}">Gửi bài dự thi ngay</a>
    @else
    <a class="btn-send-2" href="#" style="float: left">Cuộc thi đã kết thúc</a>
    @endif
</div>
<div class="box-btn-right color99 PdT5 PdL10"> Kết thúc lúc {{ date('h:i',$contest->end) }} ngày {{
    date('d/m/Y',$contest->end) }}
</div>

<?
$duration1 = ($contest->end - time() > 0) ? $contest->end - time() : 0;
?>

<script language="javascript" type="text/javascript">
    var duration1 = <?= $duration1 ?>;
    function clock1() {
        if (duration1 > 0)
            duration1 = duration1 - 1;
        if (duration1 == 0) {
            document.getElementById("second1").innerHTML = "00";
            document.getElementById("day1").innerHTML = "00";
            document.getElementById("hour1").innerHTML = "00";
            document.getElementById("min1").innerHTML = "00";
            intPro1 = window.clearInterval(intPro1);
        } else {
            var hour = Math.floor(duration1 / 3600);
            var day1 = Math.floor(hour / 24);
            var hour1 = hour - (day1 * 24);
            var min1 = Math.floor(duration1 / 60) % 60;
            var second1 = duration1 % 60;
            if (day1 < 10) {
                day1 = "0" + day1;
            }
            if (hour1 < 10) {
                hour1 = "0" + hour1;
            }
            if (min1 < 10) {
                min1 = "0" + min1;
            }
            if (second1 < 10) {
                second1 = "0" + second1;
            }
            document.getElementById("day1").innerHTML = day1;
            document.getElementById("hour1").innerHTML = hour1;
            document.getElementById("min1").innerHTML = min1;
            document.getElementById("second1").innerHTML = second1;
        }
    }
    var intPro1 = self.setInterval('clock1()', 1000);
</script>